import request from '@/utils/request'
import {getToken} from '@/utils/auth'
var token = getToken()

//列表
export function getRoleList(data) {
  return request({
    url: '/api/admin/role',
    method: 'get',
    params:data
  })
}
//新增
export function getRoleAdd(data) {
    return request({
      url: '/api/admin/role/create',
      method: 'post',
      data
    })
  }
// 修改
export function getRoleUpdate(data) {
    return request({
      url: '/api/admin/role/edit',
      method: 'post',
      data
    })
  }
// 删除
export function getRoleDelete(data) {
  return request({
    url: '/api/admin/role/delete',
    method: 'post',
    data
  })
}

//权限
export function getRoleMenu(data) {
  return request({
    url: '/api/admin/role/menu',
    method: 'post',
    data
  })
}
//提交权限
export function getRoleMenuPost(data) {
  return request({
    url: '/api/admin/role/post-menu',
    method: 'post',
    data
  })
}



